﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MINERP.DisjoinProForOutShop.IView;
using MINERP.MODEL.FoundationModel;

namespace MINERP.DisjoinProForOutShop.Forms
{
    public partial class OutShopUGrid : UGrid, IGrid
    {
        public OutShopUGrid()
        {
            InitializeComponent();
        }
        //public int GridId { get; set; }
        public int OutShopId { get; set; }
        public string GridName 
        { set { this.labGridName.Text = value;}
          get { return this.labGridName.Text; }
        }
        public DateTime FristEnterTime { set; get; }
        public DateTime CompleteTime
        { set; get; }

        public String OutShopName 
        { 
            set 
            {
                this.labelControlOutShopName.Text = value.ToString();
            }
            get
            {
                return labelControlOutShopName.Text;
            }
        }
        public int AllNum
        {
           get { return Convert.ToInt32(labelControl_ProductNumAll.Text);}
            set { labelControl_ProductNumAll.Text = value.ToString();}
        }
        public  int CurrNum
        {
            set { labelControl_PhotoNumCurr.Text = value.ToString();}
            get { return Convert.ToInt32(labelControl_PhotoNumCurr.Text);}
        }
        private void UGrid_Load(object sender, EventArgs e)
        {
            SetEvent(this);
        }

        public Grid_Info Grid
        {
            get; set;
        }

        public void ClearGrid()
        {
            AllNum = 0;
            CurrNum = 0;
            OutShopName = "";
        }
        public void SetEvent(Control control)
        {
            control.Click += new EventHandler(OutShopUGrid_Click);
            control.DoubleClick += new EventHandler(OutShopUGrid_DoubleClick);
            ControlCollection ccl = control.Controls;
            foreach (Control collection in ccl)
            {
                SetEvent(collection);
            }

        }
        public delegate void PostClicks(OutShopUGrid shopUGrid);

        public event PostClicks OutShopDoubleClick;
        public event PostClicks OutShopClick;

        private void OutShopUGrid_Click(object sender, EventArgs e)
        {
            OutShopClick(this);
        }

        private void OutShopUGrid_DoubleClick(object sender, EventArgs e)
        {
            OutShopDoubleClick(this);
        }

        private void labGridName_Click(object sender, EventArgs e)
        {
            OutShopClick(this);
        }

        private void labGridName_DoubleClick(object sender, EventArgs e)
        {
            OutShopDoubleClick(this);
        }

        private void labelControl3_Click(object sender, EventArgs e)
        {
            OutShopClick(this);
        }

        private void labelControl1_Click(object sender, EventArgs e)
        {
            OutShopClick(this);
        }

        private void labelControl2_Click(object sender, EventArgs e)
        {
            OutShopClick(this);
        }

        private void labelControlOutShopName_DoubleClick(object sender, EventArgs e)
        {
            OutShopDoubleClick(this);
        }

        private void labelControl_ProductNumAll_Click(object sender, EventArgs e)
        {
            OutShopClick(this);
        }
    }
}
